<?php 
$bets = safe_query("SELECT b.betID, u.username, b.money, b.date, b.itemID FROM bets AS b INNER JOIN user AS u ON b.user = u.userID ORDER BY b.date DESC LIMIT 0, 5");
//Get review

$reviews = safe_query("SELECT * FROM reviews ORDER BY DATE ASC LIMIT 0, 6");	
?>
<script type="text/javascript" src="js/bets.js"></script>
<script type="text/javascript" src="js/bets_reviews.js"></script>
<script type="text/javascript" src="js/gallery.js"></script>
<div id="betspage">
	<div class="betspage-header clearafter">
		<div class="left">
			<h1 class="heading-page">I will lorem ipsum dolor sit amet</h1>
			<div class="user-info">
				<img src="images/avata2.png" class="left" />
				<div class="right">
					<span class="username">MyUserName</span>
					<span class="rating">
						Rating : <strong>100%</strong>
					</span>
				</div>
				<div class="user-info-dropdown">
					<ul>
						<li class="clearafter level">
							<span class="left">User level:</span>
							<span class="right">5</span>
						</li>
						<li class="clearafter delivered">
							<span class="left">Delivered gigs:</span>
							<span class="right">356</span>
						</li>
						<li class="clearafter member">
							<span class="left">Member for:</span>
							<span class="right">2</span>
						</li>
						<li class="contactSeller"><a href="#">Contact seller</a></li>
						<li class="last viewProfile"><a href="#">View profile</a></li>
					</ul>
				</div>
			</div>
		</div>
		<div class="right">
			<span class="money right">$20</span>
			<div class="clearbreak"></div>
			<span class="created right">Created on <strong>14th of Aug</strong> in <a href="#"><strong>Politics</strong></a></span>
			<div class="clearbreak"></div>
		</div>
	</div>	   
    <div class="bets-content clearafter">
    	<div class="left col-1">
        	<div class="gallery">
        		<div id="bigPic">
					<img src="images/1.jpg" alt="" />
					<img src="images/2.jpg" alt="" />
					<img src="images/3.jpg" alt="" />
				</div>					
				<ul id="thumbs">
					<li class='active' rel='1'><img src="images/1_thumb.jpg" alt="" /></li>
					<li rel='2'><img src="images/2_thumb.jpg" alt="" /></li>
					<li rel='3' class="last"><img src="images/3_thumb.jpg" alt="" /></li>
				</ul>
        	</div>
        </div>
        <div class="left col-2">
        	<p class="description">
            	Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tortor lacus,t congue sit amet ullamcorper ut, interdum nec ante. Nam vehicula eleifend enim eget sagittis. Ut sed velit augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dictum elementum odio non rutrum.
            </p>
        </div>
        <div class="right col-3">
        	<a href="#" class="btn-order-now">Order now</a>
        	<div class="order-info clearafter">
        		<div class="left">
        			<strong>Delivery in:</strong>
        			<br />
        			<span class="number">2</span> days
        		</div>
        		<div class="right">
        			<strong>In queue:</strong>
        			<br />
        			<span class="number">4</span> orders
        		</div>
        	</div>
        	<div class="order-feedback">
        		<strong>90%</strong> positive feedback
        	</div>
        	<div class="addthis">
        		<!-- AddThis Button BEGIN -->
				<div class="addthis_toolbox addthis_default_style addthis_32x32_style">			
				<a class="addthis_button_preferred_2"></a>
				<a class="addthis_button_preferred_3"></a>			
				<a class="addthis_button_compact"></a>
				<a class="addthis_counter addthis_bubble_style"></a>
				</div>
				<script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=xa-50574f5e61f81ada"></script>
				<!-- AddThis Button END -->
        	</div>
        </div>
    </div>
    <div class="order-review clearafter">
    	<div class="left">
    		<h3>Positive reviews <span>(51)</span></h3>
    		<ul>
    			<?php 
    			if ($reviews) {
					while($review = mysql_fetch_array($reviews )) {
    			?>
    			<li>
    				<div class="clearafter">
	    				<strong><?=$review["name"]?></strong>
	    				<span class="right time"><?=ago($review["date"])?></span>
    				</div>
    				<p><?=$review["content"]?></p>
    			</li>
    			<?php 
    				}
				}
				?>  			
    		</ul>
    		<div class="loadmore"><a href="">Load more</a></div>
    	</div>
    	<div class="right">    	
    		<h3>Negative reviews <span>(4)</span></h3>
    		<ul>
    			<li>
    				<div class="clearafter">
	    				<strong>SomeUsrname</strong>
	    				<span class="right time">1 hour ago</span>
    				</div>
    				<p>Lorem ipsum dolor sit amet dolor dolan</p>
    			</li>
    			<li>
    				<div class="clearafter">
	    				<strong>SomeUsrname</strong>
	    				<span class="right time">1 hour ago</span>
    				</div>
    				<p>Lorem ipsum dolor sit amet dolor dolan</p>
    			</li>
    			<li>
    				<div class="clearafter">
	    				<strong>SomeUsrname</strong>
	    				<span class="right time">1 hour ago</span>
    				</div>
    				<p>Lorem ipsum dolor sit amet dolor dolan</p>
    			</li>
    			<li>
    				<div class="clearafter">
	    				<strong>SomeUsrname</strong>
	    				<span class="right time">1 hour ago</span>
    				</div>
    				<p>Lorem ipsum dolor sit amet dolor dolan</p>
    			</li>
    			<li>
    				<div class="clearafter">
	    				<strong>SomeUsrname</strong>
	    				<span class="right time">1 hour ago</span>
    				</div>
    				<p>Lorem ipsum dolor sit amet dolor dolan</p>
    			</li>
    		</ul>
    	</div>
    </div>
</div>